package com.itly.controller;


import com.itly.entity.Admin;
import com.itly.service.impl.AdminServiceImpl;
import com.itly.util.ApiResult;
import com.itly.util.ApiResultHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminController {
    private Logger logger = LoggerFactory.getLogger(AdminController.class);

    @Autowired
    private AdminServiceImpl adminService;

    @PutMapping("/adminPWD")
    public ApiResult updatePwd(@RequestBody Admin admin) {
        logger.info("admin...");
        adminService.updatePwd(admin);
        return ApiResultHandler.buildApiResult(200, "密码更新成功", null);
    }
}
